﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sy3_3_1_
{
    internal class Cuboid:Rect
    {
        private float height;

        // 带参构造（继承长、宽，初始化高）
        public Cuboid(float l, float w, float h) : base(l, w)
        {
            height = h;
        }

        // 重写：求矩体表面积
        public override float GetArea()
        {
            return 2 * (length * width + length * height + width * height);
        }

        // 求体积
        public float GetVolume()
        {
            return length * width * height;
        }
    }
}
